<template>
  <div class="rcord">
    <div class="record_timeline">
      <el-timeline>
        <el-timeline-item :timestamp="String(record.createTime).replace('T', ' ')" placement="top" v-for="record in records" :key="record.wpprId">
          <el-card class="round">
            <h4>申请延迟{{record.courseName}}-{{record.workName}}</h4>
            <p>{{stuName}} 提交于 {{record.createTime}}</p>
            <div v-if="record.status == 0">
              老师暂未审批
            </div>
            <div v-if="record.status == 1">
              老师已经将作业更改为 {{String(record.postponeTime).replace('T', ' ')}}
            </div>
            <div v-if="record.status == 2">
              老师已经拒绝
            </div>
          </el-card>
        </el-timeline-item>

      </el-timeline>
    </div>
  </div>
</template>


<script>
import { getMyPostponeRecord } from '../api/user'
export default {
    props:["stuName"],
    name:"PostponeRecord",
    data() {
      return {
        records:[]
      }
    },
    methods: {
        getRecord() {
            getMyPostponeRecord().then(res => {
                if (res.code == 200) {
                  this.records = res.data.records
                } 
            })
        },
    },
    mounted() {
      this.getRecord()
    }
}
</script>

<style>

</style>